﻿package com.crl.ui.controls.buttons
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	
	/**
	 * ...
	 * @author crl
	 */
	public class CheckBox extends Button
	{
		
		public function CheckBox(mc:MovieClip) 
		{
			this._toggle=true;
			super(mc);
		}
		
		override protected function clickHandler(event:MouseEvent):void {
			if(this.selected){
				this.selected = false;
				this.state.over(true);
			}else {
				this.selected = true;
			}
			this.dispatchEvent(new MouseEvent(MouseEvent.CLICK))
		}
		
	}
	
}